// https://nuxt.com/docs/api/configuration/nuxt-config
import {defineNuxtConfig} from 'nuxt/config'
export default defineNuxtConfig({
    // 使用TypeScript
    typescript: {
        strict: true,
        typeCheck: true
    },

    // 使用Vite
    vite: {
        optimizeDeps: {
            include: [
                'naive-ui',
                'vueuc',
                'date-fns-tz',
                'date-fns'
            ]
        },
        ssr: {
            noExternal: [
                'naive-ui',
                'vueuc'
            ]
        }
    },
    // 解决CommonJS冲突
    build: {
        transpile: [
            'vueuc',
            'naive-ui',
            'date-fns',
            '@css-render/vue3-ssr'
        ]
    },
    // 模块配置
    modules: [// UnoCSS模块
    '@unocss/nuxt'],
    // CSS配置
    css: [
        '/assets/css/main.scss'
    ],
    // 其他配置
    app: {
        head: {
            title: 'Nuxt 4 Project',
            meta: [
                { charset: 'utf-8' },
                { name: 'viewport', content: 'width=device-width, initial-scale=1' },
                { name: 'description', content: 'Nuxt 4 + Vue 3 + UnoCSS + SCSS + TypeScript + Vite project' }
            ],
            link: [
                { rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' }
            ]
        }
    }
})